<?php
    $name = $_GET['name'];
    $age = $_GET['age'];
    $sex = $_GET['sex'];
    $tel = $_GET['tel'];

    // $name = "aaa";
    // $age = 18;
    // $sex = "男";
    // $tel = "384538543";

    $con = mysqli_connect('localhost','root','123456','table');

    $sql = "INSERT INTO `datas` VALUES (NULL,'$name','$age','$sex','$tel')";

    $res = mysqli_query($con,$sql);

    if(!$res){
        die("数据库出错" . mysqli_error($con));
    }

    if($res){
        // {code:1,mgs:"添加成功"}
        $arr = array("code"=>1,"msg"=>"数据添加成功");
        print_r(json_encode($arr,JSON_UNESCAPED_UNICODE));
    }

?>